home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 188 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.4 KB  |  54 lines

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: kanze@gabi.gabi-soft.fr (J. Kanze)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Throwing an exception from within a signal handler
  5. Date: 28 Jan 1996 17:03:06 GMT
  6. Organization: GABI Software, Sarl.
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <KANZE.96Jan28160858@gabi.gabi-soft.fr>
  9. References: <4dgj4m$9la@engnews1.Eng.Sun.COM> <DLCosx.Hn1@falcon.daytonoh.attgis.com>
  10.     <KANZE.96Jan19122409@gabi.gabi-soft.fr> <4ebptg$frt@galaxy.ucr.edu>
  11. NNTP-Posting-Host: taumet.eng.sun.com
  12. Content-Type: text
  13. X-Nntp-Posting-Host: gabi.gabi-soft.fr
  14. In-Reply-To: thp@cs.ucr.edu's message of 27 Jan 96 00:18:38 GMT
  15. Content-Length: 1579
  16. Originator: clamage@taumet
  17.  
  18. In article <4ebptg$frt@galaxy.ucr.edu> thp@cs.ucr.edu (Tom Payne)
  19. writes:
  20.  
  21. > : From ISO 9899, section 7.7.1.1: ``If the signal occurs other than as the
  22. > : result of calling the abort or raise function, the behavior is undefined
  23. > : if the signal handler calls any function in the standard library other
  24. > : than the signal function itself (with a first argument of the signal
  25. > : number corresponding to the signal tha caused the invocation of the
  26. > : handler) or refers to any object with static storage duration other than
  27. > : by assigning a value to a static storage duration variable of type
  28. > : volatile sig_atomic_t.''
  29. > [...]
  30. > In other words, the only asynchronous activity allowed to programs
  31. > with defined behavior is polling volatile atomic variables that are
  32. > set by signal handlers.  Thus far, no one has given me a reason for
  33. > prohibiting signal handlers from reading volatile atomic variables,
  34. > which is a common practice in interrupt handlers (even those written
  35. > in C/C++).
  36.  
  37. Correct.  In practice, I cannot conceive of an implementation where
  38. writing something would be atomic, but reading it wouldn't.  On the
  39. other hand, read/modify/write will frequently not be atomic.  And why
  40. else might you want to read an object in a signal handler, if not to
  41. modify it?
  42.  
  43. -- 
  44. James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
  45. GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
  46. Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
  47.               -- A la recherche d'une activitΘ dans une region francophone
  48.  
  49. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  50.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  51.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  52.  
  53.